
<!--客户列表-->
<!--包含属性：客户编号cno、客户姓名name、客户性别sex、客户年龄age、客户联系方式tel、
客户到访次数times、客户重要程度level、喜好preference、购买状态state -->

<template>
  <div>
    <el-card style="margin: 10px">
      <el-table
        :data="customerData"
        stripe
        class="table">
        <el-table-column
          prop="cno"
          label="编号"
          width="180">
        </el-table-column>
        <el-table-column
          prop="name"
          label="姓名"
          width="180">
        </el-table-column>
        <el-table-column
          prop="sex"
          label="性别"
          width="180">
        </el-table-column>
        <el-table-column
          prop="tel"
          label="联系方式">
        </el-table-column>
        <el-table-column
          prop="times"
          label="到访次数">
        </el-table-column>
        <el-table-column
          prop="sno"
          label="主理人">
        </el-table-column>
        <el-table-column
          prop="level"
          label="客户等级">
        </el-table-column>
        <el-table-column
          prop="preference"
          label="喜好">
        </el-table-column>
        <el-table-column
          prop="buynum"
          label="成交量">
        </el-table-column>
        <el-table-column width="110px">
          <template slot-scope="scope">
            <el-button type="primary" @click="toNewOrder(scope.row)">新增订单</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
<!--    <el-dialog
      title="新增订单"
      :visible.sync="dialogVisible"
      width="30%"
      :before-close="handleClose">
      <div>
        <el-form :model="addCustomer" label-position="left" label-width="30%">
          <el-form-item label="姓名">
            <el-input v-model="addCustomer.name" style="width: 90%"></el-input>
          </el-form-item>
          <el-form-item label="性别">
            <el-radio v-model="addCustomer.sex" label="f">男</el-radio>
            <el-radio v-model="addCustomer.sex" label="m">女</el-radio>
          </el-form-item>
          <el-form-item label="年龄">
            <el-input-number v-model="addCustomer.age" style="width: 60%"></el-input-number>
          </el-form-item>
          <el-form-item label="联系电话">
            <el-input v-model="addCustomer.tel" style="width: 90%"></el-input>
          </el-form-item>
          <el-form-item label="经手人">
            <el-input v-model="addCustomer.sno" style="width: 90%"></el-input>
          </el-form-item>
        </el-form>
      </div>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="newCustomer">确 定</el-button>
  </span>
    </el-dialog>-->
  </div>
</template>

<script>
  export default {
    name: "CustomerTable",
    props:{
      customerData:[],
    },
    data() {
      return {
        dialogVisible:false,
        /*新增订单*/
      }
    },
    methods:{
      toNewOrder(param){
        this.$router.push({
          path:'/customer/new/NewOrder',
          query:{
            cno:param.cno,
          }
          }
        )
      }
    }
  }
</script>

<style scoped>
  .table{
    width:100%;
    height:770px;
    overflow-y: scroll;
  }
</style>
